#include <iostream>
#include <string>
using namespace std;
int main()
{
	string str;
	while(cin>>str)
	{
		int count = 0;
		for (int i = str.size() - 1; i >= 0; --i)
		{
			if (str[i] >= 'p' && str[i] <= 'z')
				++count;
			else if(str[i]=='N')
			{
				if(count==0)
					break;
			}
			else if(str[i]=='C'||str[i]=='D'||str[i]=='I'||str[i]=='E')
			{
				if(count<2)
				{
					count = 0;
					break;
				}
				--count;
			}
			else
			{
				count = 0;
				break;
			}

		}
		if (count == 1)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}